﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Design.AttachProperty
{
    public class AttachString
    {
         public static readonly DependencyProperty StringTBProperty;
        public static System.String Getstring(DependencyObject obj)
        {
            return (System.String)obj.GetValue(StringTBProperty);
        }
        public static void Setstring(DependencyObject obj, System.String value)
        {
           
            obj.SetValue(StringTBProperty, value);
        }
        static AttachString()
    {
       
      //register attached dependency property

        var metadata = new PropertyMetadata((System.String)null);
      StringTBProperty = DependencyProperty.RegisterAttached("StringTB",
                                                          typeof (System.String),
                                                          typeof(AttachString), metadata);
    }
    }
}
